/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.edu.unmsm.pacis.shca.domain.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.*;

/**
 *
 * @author solriver
 */
@Entity
@Table(name = "paquete_familia", catalog = "bdshca")
@NamedQueries({
    @NamedQuery(name = "PaqueteFamilia.findAll", query = "SELECT p FROM PaqueteFamilia p"),
    @NamedQuery(name = "PaqueteFamilia.findByIdPaqueteFamilia", query = "SELECT p FROM PaqueteFamilia p WHERE p.idPaqueteFamilia = :idPaqueteFamilia"),
    @NamedQuery(name = "PaqueteFamilia.findByPaqFecha", query = "SELECT p FROM PaqueteFamilia p WHERE p.paqFecha = :paqFecha")})
public class PaqueteFamilia implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "id_paquete_familia")
    private Integer idPaqueteFamilia;
    @Column(name = "paq_fecha")
    @Temporal(TemporalType.DATE)
    private Date paqFecha;
    @JoinColumn(name = "npa_id_nombre_paquete", referencedColumnName = "id_nombre_paquete")
    @ManyToOne(optional = false)
    private NombrePaquete npaIdNombrePaquete;
    @JoinColumn(name = "vis_id_visita_domiciliaria", referencedColumnName = "id_visita_domiciliaria")
    @ManyToOne(optional = false)
    private VisitaDomiciliaria visIdVisitaDomiciliaria;

    public PaqueteFamilia() {
    }

    public PaqueteFamilia(Integer idPaqueteFamilia) {
        this.idPaqueteFamilia = idPaqueteFamilia;
    }

    public Integer getIdPaqueteFamilia() {
        return idPaqueteFamilia;
    }

    public void setIdPaqueteFamilia(Integer idPaqueteFamilia) {
        this.idPaqueteFamilia = idPaqueteFamilia;
    }

    public Date getPaqFecha() {
        return paqFecha;
    }

    public void setPaqFecha(Date paqFecha) {
        this.paqFecha = paqFecha;
    }

    public NombrePaquete getNpaIdNombrePaquete() {
        return npaIdNombrePaquete;
    }

    public void setNpaIdNombrePaquete(NombrePaquete npaIdNombrePaquete) {
        this.npaIdNombrePaquete = npaIdNombrePaquete;
    }

    public VisitaDomiciliaria getVisIdVisitaDomiciliaria() {
        return visIdVisitaDomiciliaria;
    }

    public void setVisIdVisitaDomiciliaria(VisitaDomiciliaria visIdVisitaDomiciliaria) {
        this.visIdVisitaDomiciliaria = visIdVisitaDomiciliaria;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idPaqueteFamilia != null ? idPaqueteFamilia.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof PaqueteFamilia)) {
            return false;
        }
        PaqueteFamilia other = (PaqueteFamilia) object;
        if ((this.idPaqueteFamilia == null && other.idPaqueteFamilia != null) || (this.idPaqueteFamilia != null && !this.idPaqueteFamilia.equals(other.idPaqueteFamilia))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "pe.edu.unmsm.pacis.shca.domain.entity.PaqueteFamilia[ idPaqueteFamilia=" + idPaqueteFamilia + " ]";
    }
    
}
